home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Dev / Obrn-A_1.6_lib.lha / oberon-a / source3.lha / source / AmigaUtil / TimerUtil.mod < prev    next >
Text File  |  1995-06-29  |  1KB  |  51 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: TimerUtil.mod $
  4.   Description: Support for clients of timer.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:18:08 $
  10.  
  11.   Copyright © 1994, Frank Copeland.
  12.   This file is part of the Oberon-A Library.
  13.   See Oberon-A.doc for conditions of use and distribution.
  14.  
  15. ***************************************************************************)
  16.  
  17. <* STANDARD- *>
  18.  
  19. MODULE TimerUtil;
  20.  
  21. IMPORT e := Exec, es := ExecSupport, t := Timer;
  22.  
  23. (*------------------------------------*)
  24. (*
  25.  * An AmigaDOS 1.3 implementation of the AmigaDOS 2.0+ function.  Based on
  26.  * an example in the 2nd edition RKM:Libraries and Devices.
  27.  *)
  28. PROCEDURE GetSysTime * ( req : t.TimeRequestPtr; VAR dest : t.TimeVal );
  29.  
  30.   VAR port : e.MsgPortPtr; result : SHORTINT;
  31.  
  32. BEGIN (* GetSysTime *)
  33.   dest.secs := 0; dest.micro := 0; port := NIL;
  34.   IF req.node.message.replyPort = NIL THEN
  35.     port := es.CreatePort ("", 0);
  36.     IF port # NIL THEN req.node.message.replyPort := port
  37.     ELSE RETURN
  38.     END
  39.   END;
  40.   req.node.message.node.type := e.message;
  41.   req.node.message.node.pri := 0;
  42.   req.node.message.node.name := NIL;
  43.   req.node.command := t.getSysTime;
  44.   result := e.DoIO (req);
  45.   dest := req.time;
  46.   IF port # NIL THEN es.DeletePort (port) END
  47. END GetSysTime;
  48.  
  49. END TimerUtil.
  50.  
  51.